package net.comfycastle.musicplayer;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class TitleFragment extends BaseGeneralFragment {
	
	private static final String KEY_TITLE = "TitleFragment.keyTitle";

	public static TitleFragment newInstance(String title) {
		TitleFragment instance = new TitleFragment();

		Bundle bundle = new Bundle();
		bundle.putString(KEY_TITLE, title);
		instance.setArguments(bundle);

		return instance;
	} // end newInstance(FragmentId, String, String, boolean)
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.title, container, false);
		((TextView)view.findViewById(R.id.title_main)).setText(getTitle());
		return view;
	} // end onCreateView
	
	public String getTitle() {
		return getArguments().getString(KEY_TITLE);
	} // end getName
}